import request from '@/utils/request'

// 查询项目角色列表
export function listRole(query) {
  return request({
    url: '/app-api/business/project/role/list',
    method: 'get',
    params: query
  })
}

export function listRoleAllocation(query) {
  return request({
    url: '/app-api/app-api/business/project/role/allocation/list',
    method: 'get',
    params: query
  })
}

// 查询项目角色详细
export function getRole(projectRoleId) {
  return request({
    url: '/app-api/business/project/role/' + projectRoleId,
    method: 'get'
  })
}

// 新增项目角色
export function addRole(data) {
  return request({
    url: '/app-api/business/project/role',
    method: 'post',
    data: data
  })
}

// 修改项目角色
export function updateRole(data) {
  return request({
    url: '/app-api/business/project/role',
    method: 'put',
    data: data
  })
}

// 删除项目角色
export function delRole(projectRoleId) {
  return request({
    url: '/app-api/business/project/role/' + projectRoleId,
    method: 'delete'
  })
}

export function authLoopGroup(data) {
    return request({
        url: '/app-api/business/project/role/auth/loopGroup',
        method: 'post',
        data: data
    })
}

export function selectLoopGroup(projectRoleId) {
    return request({
        url: '/app-api/business/project/role/loopGroup/' + projectRoleId,
        method: 'get'
    })
}
